<template>
  <div>
    <CheckboxGroup
      class="toggle-list"
      v-model="pageStatus"
      @on-change="routePageStatus"
      v-show="visible.toggleList"
    >
      <Tooltip placement="bottom" theme="light">
        <Badge :count="warningCount.monitor">
          <Checkbox label="monitor">
            <i class="icon icon-ecology-monitor"></i>
          </Checkbox>
        </Badge>
        <div slot="content">
          <div class="title">监测</div>
          <div class="subtitle">Monitor</div>
        </div>
      </Tooltip>
      <Tooltip placement="bottom" theme="light">
        <Badge :count="warningCount.maintain">
          <Checkbox label="maintain">
            <i class="icon icon-ecology-maintain"></i>
          </Checkbox>
        </Badge>
        <div slot="content">
          <div class="title">养护</div>
          <div class="subtitle">Maintain</div>
        </div>
      </Tooltip>
      <Tooltip placement="bottom" theme="light">
        <Badge :count="warningCount.record">
          <Checkbox label="ecologicalRecord">
            <i class="icon icon-ecological-record"></i>
          </Checkbox>
        </Badge>
        <div slot="content">
          <div class="title">生态档案</div>
          <div class="subtitle">Ecological<br />Record</div>
        </div>
      </Tooltip>
      <Tooltip placement="bottom" theme="light">
        <Badge :count="warningCount.scheme">
          <Checkbox label="schemeEdit">
            <i class="icon icon-ecology-scheme"></i>
          </Checkbox>
        </Badge>
        <div slot="content">
          <div class="title">方案编辑</div>
          <div class="subtitle">Scheme Edit</div>
        </div>
      </Tooltip>
      <Tooltip placement="bottom" theme="light">
        <Badge :count="warningCount.growthSim">
          <Checkbox label="growthSimulation">
            <i class="icon icon-ecology-growth"></i>
          </Checkbox>
        </Badge>
        <div slot="content">
          <div class="title">生长模拟</div>
          <div class="subtitle">Growth<br />Simulation</div>
        </div>
      </Tooltip>
      <Tooltip placement="bottom" theme="light">
        <Badge :count="warningCount.simulation">
          <Checkbox label="waterLevelSimulation">
            <i class="icon icon-ecology-simulation"></i>
          </Checkbox>
        </Badge>
        <div slot="content">
          <div class="title">水位模拟</div>
          <div class="subtitle">Water Level<br />Simulation</div>
        </div>
      </Tooltip>
    </CheckboxGroup>
    <vc-legend
      class="ecology-legend"
      title="选择查看类别"
      icon-name="icon-legend-header"
      v-if="visible.selectViewType"
    >
      <vc-legend-item
        id="poi-water"
        color="#0080FF"
        title="水"
        @on-checked="GetWaterPOI()"
        @on-unchecked="RemoveWaterPOI()"
      ></vc-legend-item>
      <vc-legend-item
        id="poi-earth"
        color="#DCA027"
        title="土"
        @on-checked="GetSoilPOI()"
        @on-unchecked="RemoveSoilPOI()"
      ></vc-legend-item>
      <vc-legend-item
        id="poi-air"
        color="#1BABB0"
        title="气"
        @on-checked="GetAirPOI()"
        @on-unchecked="RemoveAirPOI()"
      ></vc-legend-item>
      <vc-legend-item
        id="poi-plant"
        color="#75D100"
        title="植物"
        @on-checked="GetPlantPOI()"
        @on-unchecked="RemovePlantPOI()"
      ></vc-legend-item>
      <vc-legend-item
        id="poi-animal"
        color="#7A81FF"
        title="动物"
        @on-checked="GetAnimalPOI()"
        @on-unchecked="RemoveAnimalPOI()"
      ></vc-legend-item>
      <button class="c-button overall c-button-mroe" @click="changePage()">
        <span class="text">更多</span>
      </button>
    </vc-legend>

    <vc-simulation
      title="水位"
      class="float-panel water-level-simulation"
      icon-name="icon-water-level-simulation"
      v-if="visible.waterLevelSimulator"
      @on-change="simulateWaterLevel"
    >
    </vc-simulation>
    <vc-simulation
      title="生长"
      class="float-panel water-level-simulation"
      icon-name="icon-growth-level-simulation"
      v-if="visible.growthLevelSimulator"
      @on-change="simulateGrowthLevel"
    >
    </vc-simulation>

    <vw-right v-if="visible.ecologicalRecordQuery">
      <div
        class="box float-panel ecological-overall"
        :style="{ height: boxHeight + 'px' }"
      >
        <div class="box-header box-header-panel">
          <i class="icon icon-ecological-overall"></i>
          <span class="title">生态档案概况</span>
          <div class="box-extra">
            <button class="c-button icon-btn" @click="toggleBoxBody">
              <i class="icon" :class="iconArrowStyle"></i>
            </button>
          </div>
        </div>
        <div class="box-body" v-show="visible.boxBody">
          <div class="item" style="position: relative">
            <button
              class="c-button c-button-darken"
              @click="showEcologicalOverall"
            >
              <span class="text">场景中弹窗显示</span>
            </button>
          </div>
        </div>
      </div>
      <vc-dynamic-form
        ref="dynamicForm"
        class="float-panel ecological-record"
        form-name="生态档案查询"
        icon-name="icon-ecological-record"
        @on-query="GetHightlightPOI"
      ></vc-dynamic-form>
    </vw-right>

    <vw-right v-show="visible.dataPanel">
      <vw-glass class="ripple">
        <span
          @click="popHTMLWindow(modalHrefs.fivetwo)"
          style="cursor: pointer"
        >
          <ve-chart-liquid
            class="ecology chart-liquid chart-index-1"
            id="another-ecology-index"
            title="生态健康指数"
            unit="分"
            :chart-data="chartData.ecologyIndex"
            :height="192 * ratio"
          ></ve-chart-liquid>
        </span>
      </vw-glass>
      <vw-row>
        <vw-box box-type="tower">
          <vw-box-item>
            <vw-list>
              <vw-list-item box-type="train">
                <ve-chart-gauge
                  id="chart-background-index"
                  :height="114 * ratio"
                  class="chart-gauge"
                  :chart-data="chartData.backgroundIndex"
                  title="本底指数"
                  :number="chartData.backgroundIndex"
                  unit="分"
                ></ve-chart-gauge>
                <div class="stick-group">
                  <vc-stick
                    title="森林蓄积量"
                    :bad="state.bad.forestStorage"
                    :good="state.good.forestStorage"
                    :number="dataPanel.background.forestStorage"
                    unit="分"
                  ></vc-stick>
                  <vc-stick
                    title="自然湿地保有率"
                    :bad="state.bad.wetlandRetention"
                    :good="state.good.wetlandRetention"
                    :number="dataPanel.background.wetlandRetention"
                    unit="分"
                  ></vc-stick>
                  <vc-stick
                    title="透水面占比"
                    :bad="state.bad.previousArea"
                    :good="state.good.previousArea"
                    :number="dataPanel.background.previousArea"
                    unit="分"
                  ></vc-stick>
                </div>
              </vw-list-item>
              <vw-list-item box-type="train">
                <ve-chart-gauge
                  id="chart-biotope-index"
                  :height="114 * ratio"
                  :chart-data="chartData.biotopeIndex"
                  class="chart-gauge"
                  title="生境指数"
                  :number="chartData.biotopeIndex"
                  unit="分"
                ></ve-chart-gauge>
                <div class="stick-group">
                  <!-- <vc-stick
                    title="水体质量"
                    :bad="state.bad.waterQuality"
                    :good="state.good.waterQuality"
                    :number="dataPanel.biotope.waterQuality"
                    unit="分"
                  ></vc-stick> -->
                  <vc-stick
                    title="水体质量"
                    :bad="state.bad.waterQuality"
                    :good="state.good.waterQuality"
                    :number="dataPanel.biotope.waterQuality"
                    unit="分"
                  ></vc-stick>
                  <vc-stick
                    title="空气质量"
                    :bad="state.bad.airQuality"
                    :good="state.good.airQuality"
                    :number="dataPanel.biotope.airQuality"
                    unit="分"
                  ></vc-stick>
                  <vc-stick
                    title="土壤质量"
                    :bad="state.bad.earthQuality"
                    :good="state.good.earthQuality"
                    :number="dataPanel.biotope.earthQuality"
                    unit="分"
                  ></vc-stick>
                </div>
              </vw-list-item>
              <vw-list-item box-type="train">
                <ve-chart-gauge
                  id="chart-biology-index"
                  :height="114 * ratio"
                  :chart-data="chartData.biologyIndex"
                  class="chart-gauge"
                  title="生物指数"
                  :number="chartData.biologyIndex"
                  unit="分"
                ></ve-chart-gauge>
                <div class="stick-group">
                  <vc-stick
                    title="鸟类多样性"
                    :bad="state.bad.birds"
                    :good="state.good.birds"
                    :number="dataPanel.biology.birds"
                    unit="分"
                  ></vc-stick>
                  <vc-stick
                    title="哺乳多样性"
                    :bad="state.bad.mammal"
                    :good="state.good.mammal"
                    :number="dataPanel.biology.mammal"
                    unit="分"
                  ></vc-stick>
                  <vc-stick
                    title="鱼类多样性"
                    :bad="state.bad.fish"
                    :good="state.good.fish"
                    :number="dataPanel.biology.fish"
                    unit="分"
                  ></vc-stick>
                </div>
              </vw-list-item>
            </vw-list>
            <vw-list>
              <vw-list-item box-type="train">
                <ve-chart-gauge
                  id="chart-comfortable-index"
                  :height="114 * ratio"
                  :chart-data="chartData.comfortableIndex"
                  class="chart-gauge"
                  title="舒适指数"
                  :number="chartData.comfortableIndex"
                  unit="分"
                ></ve-chart-gauge>
                <div class="stick-group">
                  <vc-stick
                    title="气候舒适度"
                    :bad="state.bad.air"
                    :good="state.good.air"
                    :number="dataPanel.comfortable.air"
                    @on-warning-checked=""
                    @on-warning-unchecked=""
                    unit="分"
                  ></vc-stick>
                  <vc-stick
                    title="负氧离子"
                    :bad="state.bad.NOI"
                    :good="state.good.NOI"
                    :number="dataPanel.comfortable.NOI"
                    unit="分"
                  ></vc-stick>
                  <vc-stick
                    title="噪声强度"
                    :bad="state.bad.noise"
                    :good="state.good.noise"
                    :number="dataPanel.comfortable.noise"
                    unit="分"
                  ></vc-stick>
                </div>
              </vw-list-item>
              <vw-list-item box-type="train">
                <ve-chart-gauge
                  id="chart-worth-index"
                  :height="114 * ratio"
                  :chart-data="chartData.worthIndex"
                  class="chart-gauge"
                  title="价值指数"
                  :number="chartData.worthIndex"
                  unit="分"
                ></ve-chart-gauge>
                <div class="stick-group">
                  <vc-stick
                    title="固碳服务"
                    :bad="state.bad.FCar"
                    :good="state.good.FCar"
                    :number="dataPanel.worth.FCar"
                    unit="分"
                  ></vc-stick>
                  <vc-stick
                    title="气候调节"
                    :bad="state.bad.weatherTune"
                    :good="state.good.weatherTune"
                    :number="dataPanel.worth.weatherTune"
                    unit="分"
                  ></vc-stick>
                  <vc-stick
                    title="土壤保持"
                    :bad="state.bad.earthRemaining"
                    :good="state.good.earthRemaining"
                    :number="dataPanel.worth.earthRemaining"
                    unit="分"
                  ></vc-stick>
                </div>
              </vw-list-item>
              <vw-list-item box-type="train">
                <ve-chart-gauge
                  id="chart-resource-index"
                  :height="114 * ratio"
                  :chart-data="chartData.resourceIndex"
                  class="chart-gauge"
                  title="资源指数"
                  :number="chartData.resourceIndex"
                  unit="分"
                ></ve-chart-gauge>
                <div class="stick-group">
                  <vc-stick
                    title="人均能耗"
                    :bad="state.bad.averageEnergyCost"
                    :good="state.good.averageEnergyCost"
                    :number="dataPanel.resource.averageEnergyCost"
                    unit="分"
                  ></vc-stick>
                  <vc-stick
                    title="人均水耗"
                    :bad="state.bad.averageWaterCost"
                    :good="state.good.averageWaterCost"
                    :number="dataPanel.resource.averageWaterCost"
                    unit="分"
                  ></vc-stick>
                  <vc-stick
                    title="人均垃圾产生量"
                    :bad="state.bad.averageGarbageProduce"
                    :good="state.good.averageGarbageProduce"
                    :number="dataPanel.resource.averageGarbageProduce"
                    unit="分"
                  ></vc-stick>
                </div>
              </vw-list-item>
            </vw-list>
          </vw-box-item>
        </vw-box>
      </vw-row>
    </vw-right>
    <div
      class="float-panel ecological-overall-window"
      v-if="visible.ecologicalOverallPanel"
    >
      <button
        class="c-button icon-button"
        type="button"
        @click="hideEcologicalOverall"
      >
        <i class="icon icon-ecological-overall-close"></i>
      </button>
    </div>
    <div
      class="float-panel ecological-query-result"
      v-if="visible.ecologicalQueryResult"
    >
      <i class="icon icon-ecological-query-result"></i>
      <span class="text">检索结果：{{ queryPlantCount }}</span>
    </div>
    <button
      class="c-button ecology c-button-shuttle"
      v-show="visible.btnScreenSplit"
      @click="setState_SchemeCompare"
    >
      <i class="icon icon-screen-split"></i>
      <span class="text">分屏对比</span>
    </button>
    <button
      class="c-button ecology c-button-return"
      v-show="visible.btnReturn"
      @click="pageStatus = []"
    >
      <span class="text">返回</span>
    </button>
    <div
      class="wisdomWatering-btn"
      v-if="visible.wisdomWatering"
      @click="popHTMLWindow(modalHrefs.wisdomWateringUrl)"
    >
      智慧浇灌
    </div>
  </div>
</template>

<script>
import bus from "@/lib/bus";
import { _Space, _POI } from "@/lib/vmixs";
const ratio = JSON.parse(localStorage.ratio);

import { uniFetcherEcological } from "@/request/uniFetcher.js";
export default {
  name: "",
  data() {
    return {
      modalHrefs: {
        fivetwo:
          "https://xmgl.glodon.com/cas/login;JSESSIONID=d89c0004-ba72-4cab-a84a-75cdb82528ba?service=https%3A%2F%2Fxmgl.glodon.com%2Fidentification%2Fauthenticate%3Ftype%3Dcas",
        wisdomWateringUrl: `http://eco.zggyd.com/#/ecologicMaintenance`,
      },
      iconArrowStyle: "icon-arrow-down",
      boxHeight: 36 * ratio,
      state: {
        bad: {
          earthQuality: false,
          waterQuality: false,
          airQuality: false,
          forestStorage: false,
          wetlandRetention: false,
          previousArea: false,
          birds: false,
          mammal: false,
          fish: false,
          air: false,
          NOI: false,
          noise: false,
          FCar: false,
          weatherTune: false,
          earthRemaining: false,
          averageEnergyCost: false,
          averageWaterCost: false,
          averageGarbageProduce: false,
        },
        good: {
          earthQuality: false,
          waterQuality: false,
          airQuality: false,
          forestStorage: false,
          wetlandRetention: false,
          previousArea: false,
          birds: false,
          mammal: false,
          fish: false,
          air: false,
          NOI: false,
          noise: false,
          FCar: false,
          weatherTune: false,
          earthRemaining: false,
          averageEnergyCost: false,
          averageWaterCost: false,
          averageGarbageProduce: false,
        },
      },
      //layout
      ratio: ratio,
      //interactive
      pageStatus: [],
      visible: {
        selectViewType: true,
        ecologicalRecordQuery: true,
        waterLevelSimulator: true,
        growthLevelSimulator: true,
        btnScreenSplit: true,
        btnReturn: true,
        toggleList: true,
        dataPanel: true,
        ecologicalOverallPanel: false,
        ecologicalQueryResult: false,
        wisdomWatering: false,
      },
      //data
      warningCount: {
        monitor: 0,
        maintain: 0,
        record: 0,
        scheme: 0,
        simulation: 0,
        growthSim: 0,
      },
      chartData: {
        ecologyIndex: 0,
        backgroundIndex: 0,
        biotopeIndex: 0,
        biologyIndex: 0,
        comfortableIndex: 0,
        worthIndex: 0,
        resourceIndex: 0,
      },
      queryPlantCount: 0,
      dataPanel: {
        background: {
          forestStorage: 0,
          wetlandRetention: 0,
          previousArea: 0,
        },
        biotope: {
          waterQuality: 0,
          airQuality: 0,
          earthQuality: 0,
        },
        biology: {
          birds: 0,
          mammal: 0,
          fish: 0,
        },
        comfortable: {
          air: 0,
          NOI: 0,
          noise: 0,
        },
        worth: {
          FCar: 0,
          weatherTune: 0,
          earthRemaining: 0,
        },
        resource: {
          averageEnergyCost: 0,
          averageWaterCost: 0,
          averageGarbageProduce: 0,
        },
      },
    };
  },
  mixins: [_Space, _POI],
  watch: {
    pageStatus: {
      handler(n, o) {
        if (n instanceof Array) {
          let pageStatusName = n[0];
          if (pageStatusName) {
            const statusHashMap = {
              monitor: this.setState_Monitor,
              maintain: this.setState_Maintain,
              ecologicalRecord: this.setState_EcologicalRecord,
              schemeEdit: this.setState_SchemeEdit,
              growthSimulation: this.setState_GrowthSim,
              waterLevelSimulation: this.setState_WaterLevel,
            };
            statusHashMap[n].call();
          } else {
            //执行方法，页面回到初始状态
            this.setState_Initial();
          }
        }
      },
      immediate: true,
      deep: true,
    },
  },
  created() {
    this.declarePageName();
    //this.CreateCamera();
    //this.getPanelData();
  },
  mounted() {
    bus.$on("maintain-effect", (res) => {
      console.log(res);
      let info = res.data.split("-");
      console.log(info);
      if (info[0] == "success") {
        let jsondata = {
          id: info[1] ,
          coord_type: 0, //坐标类型(0:经纬度坐标, 1:cad坐标)
          cad_mapkey: "", //CAD基准点Key值, 项目中约定
          type: "circle_outside", //样式类型; 注①
          scale: 25, //半径(单位:米)
          coord: info[2], //坐标点 lng,lat
          coord_z: 5, //高度(单位:米)
          coord_z_type: 0, //坐标高度类型(0:相对3D世界表面；1:相对3D世界地面；2:相对3D世界海拔; 注:cad坐标无效)
          pitch: 30, //俯仰角(-360~360)
          roll: 0, //翻滚角(-360~360)
          yaw: 0, //偏航角(0正北, -360~360)
          // "title_text":"标题",                 //文本内容, 富文本内容
          title_face_to_camera: true, //顶部文字是否跟踪朝向摄像机(注: true优先, "pitch", "roll", "yaw" 无效)
          title_text_portrait: true, //顶部文字排列方向(true: 纵向, false: 横向)
        };
         console.log(jsondata);
        window.cloudRender.SuperAPI(
          "AddEffect",
          jsondata,
          (status, progress) => {
            console.log(status, progress);
          }
        );
      } else {
        let jsondata = {
          id: info[1] , //覆盖物id
          type: "circle_outside", //覆盖物类型, 详见下表
        };
        console.log(jsondata);
        window.cloudRender.SuperAPI("RemoveEffect", jsondata);
      }
    });
  },
  components: {
    "vc-legend": () => import("../../components/Legend"),
    "vc-legend-item": () => import("../../components/LegendItem"),
    "vc-dynamic-form": () => import("../../components/DynamicForm"),
    "vc-simulation": () => import("../../components/Simulation"),
    "vw-glass": () => import("../../layout/Glass"),
    "vw-list": () => import("../../layout/List"),
    "vw-list-item": () => import("../../layout/ListItem"),
    "vc-stick": () => import("../../components/Stick"),
    "ve-chart-liquid": () => import("../../components/echarts/ChartLiquid"),
    "ve-chart-gauge": () => import("../../components/echarts/ChartGauge"),
  },
  methods: {
    declarePageName() {
      bus.$emit("set-sphere-actived", "Ecology");
      console.log();
    },
    setState_Initial() {
      //组件恢复到初始状态的显示方式
      this.visible.dataPanel = true;
      this.visible.selectViewType = false;
      this.visible.ecologicalRecordQuery = false;
      this.visible.growthLevelSimulator = false;
      this.visible.waterLevelSimulator = false;
      this.visible.btnScreenSplit = false;
      this.visible.btnReturn = false;
      this.visible.toggleList = true;
      bus.$emit("open-toolbar");
      bus.$emit("open-sphere");
      //清空场景内的图素，场景镜头聚焦
      this.InitCamera();
      this.ClearSpace();
      this.getPanelData();
      //this.clearUECreatures();
      //this.CameraObj.setOn(this.camera.init);
    },
    toggleBoxBody(boxName) {
      this.visible.boxBody = !this.visible.boxBody;
      if (this.visible.boxBody) {
        this.iconArrowStyle = "icon-arrow-up";
        this.boxHeight = 100 * ratio;
      } else {
        this.iconArrowStyle = "icon-arrow-down";
        this.boxHeight = 36 * ratio;
      }
    },
    getPanelData() {
      uniFetcherEcological.getEcologyPanelData().then((res) => {
        if (res) {
          this.chartData.ecologyIndex = parseInt(res.ecologyIndex);
          this.chartData.backgroundIndex = parseInt(res.backgroundIndex);
          this.chartData.biotopeIndex = parseInt(res.biotopeIndex);
          this.chartData.biologyIndex = parseInt(res.biologyIndex);
          this.chartData.comfortableIndex = parseInt(res.comfortableIndex);
          this.chartData.worthIndex = parseInt(res.worthIndex);
          this.chartData.resourceIndex = parseInt(res.resourceIndex);
          this.dataPanel.background.forestStorage = parseInt(
            res.background.forestStorage
          );
          this.dataPanel.background.wetlandRetention = parseInt(
            res.background.wetlandRetention
          );
          this.dataPanel.background.previousArea = parseInt(
            res.background.previousArea
          );
          this.dataPanel.biotope.waterQuality = parseInt(
            res.biotope.waterQuality
          );
          this.dataPanel.biotope.airQuality = parseInt(res.biotope.airQuality);
          this.dataPanel.biotope.earthQuality = parseInt(
            res.biotope.earthQuality
          );
          this.dataPanel.biology.birds = parseInt(res.biology.birds);
          this.dataPanel.biology.mammal = parseInt(res.biology.mammal);
          this.dataPanel.biology.fish = parseInt(res.biology.fish);
          this.dataPanel.comfortable.air = parseInt(res.comfortable.air);
          this.dataPanel.comfortable.NOI = parseInt(res.comfortable.noi);
          this.dataPanel.comfortable.noise = parseInt(res.comfortable.noise);
          this.dataPanel.worth.FCar = parseInt(res.worth.fcar);
          this.dataPanel.worth.weatherTune = parseInt(res.worth.weatherTune);
          this.dataPanel.worth.earthRemaining = parseInt(
            res.worth.earthRemaining
          );
          this.dataPanel.resource.averageEnergyCost = parseInt(
            res.resource.averageEnergyCost
          );
          this.dataPanel.resource.averageWaterCost = parseInt(
            res.resource.averageWaterCost
          );
          this.dataPanel.resource.averageGarbageProduce = parseInt(
            res.resource.averageGarbageProduce
          );
        }
      });
    },
    popHTMLWindow(hrefObj) {
      bus.$emit("open-modal", {
        type: "web",
        url: hrefObj,
      });
    },
    setState_Monitor() {
      this.visible.dataPanel = true;
      this.visible.wisdomWatering = false;
      this.visible.selectViewType = true;
      this.visible.ecologicalRecordQuery = false;
      this.visible.growthLevelSimulator = false;
      this.visible.waterLevelSimulator = false;
      this.visible.btnScreenSplit = false;
      this.visible.btnReturn = false;
      this.visible.toggleList = true;
      bus.$emit("open-toolbar");
      bus.$emit("open-sphere");
      //清空场景内的图素
      this.ClearSpace();
      //this.clearUECreatures();
    },
    setState_Maintain() {
      this.visible.dataPanel = true;
      this.visible.wisdomWatering = true;
      this.visible.selectViewType = false;
      this.visible.ecologicalRecordQuery = false;
      this.visible.growthLevelSimulator = false;
      this.visible.waterLevelSimulator = false;
      this.visible.btnScreenSplit = false;
      this.visible.btnReturn = false;
      this.visible.toggleList = true;
      bus.$emit("open-toolbar");
      bus.$emit("open-sphere");
      //清空场景内的图素
      this.ClearSpace();
      //this.clearUECreatures();
      //创建跟养护相关的POI点
      this.RenderPOI(uniFetcherEcological.getMaintainPOI);
      setTimeout(()=>{
        this.CameraObj.focusOn("POI");
      },2000)
    },
    //下面是各个养护各个POI的请求方法
    GetAirPOI() {
      //实时
      this.RenderPOI(uniFetcherEcological.getFetchDataAirPOI);
      // this.RenderPOI(uniFetcherEcological.getAirPOI);
      setTimeout(()=>{
        this.CameraObj.focusOn("POI");
      },2000)
    },
    RemoveAirPOI() {
      this.RemovePOI("气象空气");
    },
    GetAnimalPOI() {
      this.RenderPOI(uniFetcherEcological.getAnimalPOI);
      setTimeout(()=>{
        this.CameraObj.focusOn("POI");
      },2000)
    },
    RemoveAnimalPOI() {
      this.RemovePOI("动物");
    },
    GetWaterPOI() {
      //实时
      this.RenderPOI(uniFetcherEcological.getFetchDataWaterPOI);
      // this.RenderPOI(uniFetcherEcological.getWaterPOI);
      setTimeout(()=>{
        this.CameraObj.focusOn("POI");
      },2000)
    },
    RemoveWaterPOI() {
      this.RemovePOI("水");
    },
    GetSoilPOI() {
      this.RenderPOI(uniFetcherEcological.getSoilPOI);
      setTimeout(()=>{
        this.CameraObj.focusOn("POI");
      },2000)
    },
    RemoveSoilPOI() {
      this.RemovePOI("土壤");
    },
    GetPlantPOI() {
      this.RenderPOI(uniFetcherEcological.getPlantPOI);
      setTimeout(()=>{
        this.CameraObj.focusOn("POI");
      },2000)
    },
    RemovePlantPOI() {
      this.RemovePOI("植物");
    },
    changePage() {
      window.open("http://eco.zggyd.com/#/ecologicWeb");
      bus.$emit("open-modal", {
        type: "web",
      });
    },
    setState_EcologicalRecord() {
      this.visible.dataPanel = false;
      this.visible.selectViewType = false;
      this.visible.wisdomWatering = false;
      this.visible.ecologicalRecordQuery = true;
      this.visible.growthLevelSimulator = false;
      this.visible.waterLevelSimulator = false;
      this.visible.btnScreenSplit = false;
      this.visible.btnReturn = false;
      this.visible.toggleList = true;
      bus.$emit("close-toolbar");
      bus.$emit("close-sphere");
      //清空场景内的图素，场景镜头聚焦
      this.ClearSpace();
      //this.clearUECreatures();
    },
    //检索显示高亮的POI点
    GetHightlightPOI(data) {
      //this.RenderPOI();
      console.log(data);
      uniFetcherEcological.getArchivesInfo(data);
      this.visible.ecologicalQueryResult = true;
      this.queryPlantCount = 2000;
    },
    setState_SchemeEdit() {
      this.visible.dataPanel = false;
      this.visible.selectViewType = false;
      this.visible.wisdomWatering = false;
      this.visible.ecologicalRecordQuery = false;
      this.visible.growthLevelSimulator = false;
      this.visible.waterLevelSimulator = false;
      this.visible.btnScreenSplit = true;
      this.visible.btnReturn = false;
      this.visible.toggleList = true;
      bus.$emit("close-toolbar");
      bus.$emit("close-sphere");
      //清空场景内的图素，场景镜头聚焦
      this.ClearSpace();
      //this.clearUECreatures();
    },
    setState_SchemeCompare() {
      this.visible.btnScreenSplit = false;
      this.visible.btnReturn = true;
      //调用非标接口，渲染方案对比页面
      //由于该状态只能从SchemeEdit状态进入，因此不必做其他冗余的操作
      // window.cloudRender.SuperAPI("specialChannel", {
      //   actionname: "EcoComparison",
      // });
      // 方案编辑
      this.$anyInterface("API_TreeSplitActor", "SplitScreen");
    },
    setState_GrowthSim() {
      this.visible.dataPanel = false;
      this.visible.selectViewType = false;
      this.visible.ecologicalRecordQuery = false;
      this.visible.wisdomWatering = false;
      this.visible.growthLevelSimulator = true;
      this.visible.waterLevelSimulator = false;
      this.visible.btnScreenSplit = false;
      this.visible.btnReturn = false;
      this.visible.toggleList = true;
      bus.$emit("close-toolbar");
      bus.$emit("close-sphere");
      //清空场景内的图素，场景镜头聚焦
      this.ClearSpace();
      //this.clearUECreatures();
    },
    setState_WaterLevel() {
      this.visible.dataPanel = false;
      this.visible.selectViewType = false;
      this.visible.wisdomWatering = false;
      this.visible.ecologicalRecordQuery = false;
      this.visible.growthLevelSimulator = false;
      this.visible.waterLevelSimulator = true;
      this.visible.btnScreenSplit = false;
      this.visible.btnReturn = false;
      this.visible.toggleList = true;
      bus.$emit("close-toolbar");
      bus.$emit("close-sphere");
      //清空场景内的图素，场景镜头聚焦
      this.ClearSpace();
      //this.clearUECreatures();
    },
    simulateWaterLevel(val) {
      console.log("simulateWaterLevel", val);
      //调用非标接口进行水位模拟
      // window.cloudRender.SuperAPI("specialChannel", {
      //   actionname: "WaterLevel",
      //   value: val,
      // });
      this.$anyInterface("API_WaterLevelActor", "WaterLevel", "true", `${val}`);
    },
    simulateGrowthLevel(val) {
      console.log("simulateGrowthLevel", val);
      //调用非标接口进行生长模拟
      // window.cloudRender.SuperAPI("specialChannel", {
      //   actionname: "WaterLevel",
      //   value: val,
      // });
      this.$anyInterface("API_AgeControlActor", "AgeSlide", "true", `${val}`);
    },
    routePageStatus() {
      this.pageStatus = [this.pageStatus.tail()];
      console.log("this.pageStatus", this.pageStatus);
    },
    clearUECreatures() {
      //这里会调用一系列的非标API，来做清除操作
    },
    showEcologicalOverall() {
      this.visible.ecologicalOverallPanel = true;
    },
    hideEcologicalOverall() {
      this.visible.ecologicalOverallPanel = false;
    },
  },
};
</script>

<style lang="less" scoped>
</style>